﻿using System.Web.Mvc;

namespace Jzy.UI.Web.Areas.Site
{
    public class SiteAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Site";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
               "Default", // Route name
               "", // URL with parameters
               new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new string[] { "Jzy.UI.Web.Areas.Site.Controllers" } // Parameter defaults
           );

            context.MapRoute(
               "photo", // Route name
               "photos.aspx", // URL with parameters
               new { controller = "Home", action = "Photos", id = UrlParameter.Optional }, new string[] { "Jzy.UI.Web.Areas.Site.Controllers" } // Parameter defaults
           );


            context.MapRoute(
                "Jzy.Site.Job",
                "Site/Job/",
                new { controller = "Job", action = "List" }
            );

            context.MapRoute(
                "Team",
                "Site/Team/",
                new { controller = "Team", action = "List" }
            );

            context.MapRoute(
                "ArticleList",
                "Site/Article/List/{menuCode}/{currentPage}/",
                new { controller = "Article", action = "List", currentPage = 1 }
            );

            context.MapRoute(
                "ContactUs",
                "Site/ContactUs/",
                new { controller = "Home", action = "ContactUs"}
            );

            context.MapRoute(
               "ArticleDetail0",
               "Site/Article/Detail/MenuCode{menuCode}/",
               new { controller = "Article", action = "Detail" }
            );

            context.MapRoute(
             "ArticleDetail1",
             "Site/Article/Detail/ID{id}/",
             new { controller = "Article", action = "Detail" }
           );

            context.MapRoute(
              "Jzy.Site.PictureList",
              "Site/Article/PictureList/{menuCode}/{currentPage}/",
              new { controller = "Article", action = "List", currentPage = 1, menuType = 1 }
            );
            

            context.MapRoute(
                "WebSite_default",
                "Site/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );

           
        }
    }
}
